<%@ page import="com.touzi.constants.DbCons" %>
<%@ page import="org.apache.ibatis.session.SqlSessionFactory" %>
<%@ page import="org.apache.ibatis.session.SqlSession" %>
<%@ page import="com.touzi.mapper.SysconfigMapper" %>
<%@ page import="java.io.IOException" %><%--
  Created by IntelliJ IDEA.
  User: w7851
  Date: 2018/5/24
  Time: 10:15
  To change this template use File | Settings | File Templates.
  修改是否允许用户提款
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    SqlSession sqlSession = ((SqlSessionFactory) application.getAttribute(DbCons.DB_FACTORY)).openSession();
    SysconfigMapper sysconfigMapper=sqlSession.getMapper(SysconfigMapper.class);
    String baseurl=sysconfigMapper.getBaseURL();
    String newyuming=request.getParameter("yuming");
    try {
        if (newyuming!=null){
            sysconfigMapper.setBaseURL(newyuming);
            out.println("Ok");
            sqlSession.commit();
            sqlSession.close();
            return;
        }
    } catch (IOException e) {
        out.println("error");
        sqlSession.rollback();
        sqlSession.close();
        return;
    }
    sqlSession.close();
%>
<html>
<head>
    <title>Title</title>
    <meta charset="utf-8">
    <style>
        #content {
            margin: 16px auto;
            width: 400px;
        }
    </style>
</head>
<body>
<div id="content">
    <form action="" method="post">
        <%--<form>--%>
        <%--<input style="display: none" name="method" value="xiugaiyuming">--%>
        域名:<br>
        <input name="yuming" type="text" autocomplete="off" style="width: 100%" value="<%=baseurl%>"><br><br>
        <input type="submit" value="提交">
    </form>
</div>
</body>
</html>
